const express = require("express")
const cors = require("cors")
const path = require("path")
const dirRouter = path.join(__dirname, 'router')
const router = require(dirRouter)

const app = express()

app.use(cors())
app.use(express.json())
app.use(express.urlencoded({ extended: false }))

app.use("/api", router)

app.listen(8080, () => {
    console.log("服务器已经启动")
})